/**
 * Created by kenz on 2018/4/10.
 */
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
import TodoList from '../components/TodoList'
import { toggleTodo } from '../actions'


const mapStateToProps = state => {
  return {
    todos: state.todos
  }
}

const mapDispatchToProps = dispatch => ({
  onTodoClick: bindActionCreators(toggleTodo, dispatch)
})


const VisibleTodoList = connect(
  mapStateToProps,
  mapDispatchToProps
)(TodoList)


export default VisibleTodoList
